package com.yzh.openai.domain.order.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单状态
 */
@Getter
@AllArgsConstructor
public enum OrderStatusVO {
    CREATE(0, "创建完成"),
    WAIT(1, "等待发货"),
    COMPLETED(2, "发货完成"),
    CLOSE(3, "系统关单"),
    ;

    private Integer code;
    private String desc;

    public static OrderStatusVO get(Integer code) {
        switch (code) {
            case 0:
                return CREATE;
            case 1:
                return WAIT;
            case 2:
                return COMPLETED;
            case 3:
                return CLOSE;
            default:
                return CREATE;
        }
    }
}
